<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
        <meta charset="utf-8" />
        <title>{:lang('ADMIN_CENTER')} - 登录</title>

        <meta name="description" content="User login page" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />

        <!-- bootstrap & fontawesome -->
        <link rel="stylesheet" href="/static/admin/assets/css/bootstrap.min.css" />
        <link rel="stylesheet" href="/static/admin/assets/font-awesome/4.5.0/css/font-awesome.min.css" />

        <!-- text fonts -->
        <link rel="stylesheet" href="/static/admin/assets/css/fonts.googleapis.com.css" />

        <!-- ace styles -->
        <link rel="stylesheet" href="/static/admin/assets/css/ace.min.css" />

        <!--[if lte IE 9]>
            <link rel="stylesheet" href="/static/admin/assets/css/ace-part2.min.css" />
        <![endif]-->
        <link rel="stylesheet" href="/static/admin/assets/css/ace-rtl.min.css" />

        <!--[if lte IE 9]>
          <link rel="stylesheet" href="/static/admin/assets/css/ace-ie.min.css" />
        <![endif]-->

        <!-- HTML5shiv and Respond.js for IE8 to support HTML5 elements and media queries -->

        <!--[if lte IE 8]>
        <script src="/static/admin/assets/js/html5shiv.min.js"></script>
        <script src="/static/admin/assets/js/respond.min.js"></script>
        <![endif]-->

        
    </head>

    <body class="login-layout light-login">
        <div class="main-container">
            <div class="main-content">
                <div class="row">
                    <div class="col-sm-10 col-sm-offset-1">
                        <div class="login-container">
                            <div class="center">
                                <h1>
                                    <!-- <i class="ace-icon fa fa-leaf green"></i> -->
                                    <!-- <span class="red">活动管理</span> -->
                                    <span class="grey" id="id-text2">{:lang('ADMIN_CENTER')}</span>
                                </h1>
                                <!-- <h4 class="blue" id="id-company-text">登录</h4> -->
                            </div>

                            <div class="space-6"></div>

                            <div class="position-relative">

                                <div id="forgot-box" class="forgot-box visible widget-box no-border">
                                    <div class="widget-body">
                                        <div class="widget-main">
                                            <h4 class="header red lighter bigger">
                                                找回密码
                                            </h4>

                                            <form>
                                                <fieldset>
                                                    <label class="block clearfix">
                                                        <span class="block input-icon input-icon-right">
                                                            <input type="email" class="form-control" placeholder="请输入邮箱" />
                                                            <i class="ace-icon fa fa-envelope"></i>
                                                        </span>
                                                    </label>

                                                    <div class="clearfix">
                                                        <button type="button" class="width-35 pull-right btn btn-sm btn-danger">
                                                            <i class="ace-icon fa fa-lightbulb-o"></i>
                                                            <span class="bigger-110">发送</span>
                                                        </button>
                                                    </div>
                                                </fieldset>
                                            </form>
                                        </div><!-- /.widget-main -->

                                        <div class="toolbar center">
                                            <a href="{:url('Login/index')}" data-target="#login-box" class="back-to-login-link">
                                                返回登录
                                            </a>
                                        </div>
                                    </div><!-- /.widget-body -->
                                </div><!-- /.forgot-box -->


                            </div><!-- /.position-relative -->

                        </div>
                    </div><!-- /.col -->
                </div><!-- /.row -->
            </div><!-- /.main-content -->
        </div><!-- /.main-container -->

        <!-- basic scripts -->

        <!--[if !IE]> -->
        <script src="/static/admin/assets/js/jquery-2.1.4.min.js"></script>

        <script src="/static/admin/layer/layer.js"></script>

        <!-- <![endif]-->

        <!--[if IE]>
<script src="/static/admin/assets/js/jquery-1.11.3.min.js"></script>
<![endif]-->
        <script type="text/javascript">
            if('ontouchstart' in document.documentElement) document.write("<script src='/static/admin/assets/js/jquery.mobile.custom.min.js'>"+"<"+"/script>");
        </script>
        <script type="text/javascript">
             // $("body").keydown(function() {
             //     if (event.keyCode == "13") {
             //         do_login();
             //     }
             // });
            // jQuery(function($) {
            //  $(document).on('click', 'a[data-target]', function(e) {
            //     e.preventDefault();
            //     var target = $(this).data('target');
            //     $('.widget-box.visible').removeClass('visible');//hide others
            //     $(target).addClass('visible');//show target
            //  });
            // });

            function do_login(){
                var username = $.trim($('#username').val());
                var password = $.trim($('#password').val());
                // var captcha = $.trim($('#captcha').val());
                if(username == ''){
                    layer.msg('请输入用户名',{time: 1000});
                    return;
                }
                if(password == ''){
                    layer.msg('请输入密码',{time: 1000});
                    return;
                }
                // if(captcha == ''){
                //     layer.msg('请输入验证码',{time: 1000});
                //     return;
                // }

                var layer_index = layer.load(1, {
                    shade: [0.1,'#fff']
                });

                $.post( "{:url('Login/doLogin')}",$("#form").serialize(),function(data){
                        // console.log(data);
                        layer.close(layer_index);
                        if(data.code) {
                            window.location.href = "{:url('Index/index')}";
                        }else{
                            layer.msg(data.msg,{time: 1000});
                            $("#verify-img").prop('src',$("#verify-img").prop('src')+'?'+Math.random())
                        }

                    }, "json");
            }
        </script>
    </body>
</html>
